import Cookies from 'js-cookie'


const TokenKey = 'Admin-Token'
const Language = 'language';

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function getLanguage() {
  const lang = Cookies.get(Language)
  if (lang) {
    return lang
  }

  return "zh_CN";
  
}
export function getMapType() {
  return Cookies.get(Map)
}
export function setLanguage(language) {
  return Cookies.set(Language, language, {expires: 30})
}
export function setMapType(map) {
  return Cookies.set(Map, map, {expires: 30})
}
